package Homework.ooDay04;

public class StaticDemo {
    public static void main(String[] args) {
        StaticVar staticVar =new StaticVar();
        staticVar.show();
        StaticVar staticVar1 =new StaticVar();
        staticVar.show();
        staticVar1.show();
        StaticVar.show1();
    }

}

class StaticVar{
    static int i;
    int b;
    static {
        i=2;
    }
    public StaticVar(){
        i++;
        b++;
    }
    public void show(){
        System.out.println("i="+i+",b="+b);
    }
    public static void show1(){
        System.out.println("i="+i);
    }
}